#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  trickle_test.py
#       Author @  Huoty
#  Create date @  2016-04-13 10:40:28
#  Description @  
# *************************************************************

import subprocess
import multiprocessing

uri = "http://cn.archive.ubuntu.com/ubuntu/pool/main/"

def wrap_wget(url):
    cmd = "wget " + url
    subprocess.call(cmd, shell=True)
    print "-------- end --------"

# Script starts from here

if __name__ == "__main__":
    p1 = multiprocessing.Process(target=wrap_wget, args=(uri + "a/apache2/apache2-doc_2.4.7-1ubuntu4_all.deb",))
    p2 = multiprocessing.Process(target=wrap_wget, args=(uri + "a/apache2/apache2-bin_2.4.7-1ubuntu4_amd64.deb",))
    p3 = multiprocessing.Process(target=wrap_wget, args=(uri + "f/firefox/firefox-dbg_11.0+build1-0ubuntu4_amd64.deb ",))
    p4 = multiprocessing.Process(target=wrap_wget, args=(uri + "f/ffmpeg/ffmpeg-doc_0.5.1-1ubuntu1.3_all.deb",))
    p5 = multiprocessing.Process(target=wrap_wget, args=(uri + "f/firefox/firefox-dev_11.0+build1-0ubuntu4_amd64.deb",))

    p1.start()
    p2.start()
    p3.start()
    p4.start()
    p5.start()
